import request from "@/utils/request";
import qs from "qs";
//新增告警码
export function alarmCodeAdd(data) {
    return request({
        url: '/system/alarm/code/add',
        method: 'post',
        data
    })
}
export function alarmCodeUsers(query) {
    return request({
        url: '/system//alarm/code/getNoticeUsers',
        method: 'get',
        params: query
    })
}
export function alarmProductCodes(query) {
    return request({
        url: '/system/product/config/getProductCodes',
        method: 'get',
        params: query
    })
}
//业务管理列表
export function businessList(query) {
    return request({
        url: '/system/alarm/business/list',
        method: 'get',
        params: query
    })
}
//查询告警码管理列表

export function alarmCodeList(query) {
    return request({
        url: '/system/alarm/code/list',
        method: 'get',
        params: query
    })
}
//查询告警等级
export function alarmCodeGetAlarmLevel() {
    return request({
        url: '/system/alarmInfo/getAlarmLevel',
        method: 'get',
    })
}
//查询告警类型
export function alarmCodeGetAlarmType() {
    return request({
        url: "/system/alarmInfo/getAlarmType",
        method: "get"
    })
}
//编辑
export function alarmCodeEdit(data) {
    return request({
        url: "/system/alarm/code/edit",
        method: "post",
        data
    })
}
//详情
export function alarmCodeGetInfo(query) {
    return request({
        url: "/system/alarm/code/getInfo",
        method: "get",
        params: query
    })
}
//删除（操作）
export function alarmCodeRemove(data) {
    return request({
        url: "/system/alarm/code/remove",
        method: "post",
        data
    })
}
//已选择人员列表
export function getSelectedNoticeUsers(data) {
    return request({
        url: "/system/alarm/code/getSelectdNoticeUsers",
        method: "post",
        data
    })
}

//通知方式
export function fetchNoticeType(params) {
    return request({
        url: "/system/alarmInfo/alarm/NoticeTypeList",
        method: "get",
        params
    })
}

//获取通知详情
export function fetchAlarmInfo(params) {
    return request({
        url: "/system/alarmInfo/gsAlarmInfo?auditId=" + params.auditId,
        method: "get",
        headers: {
            "Authorization": 'Bearer ' + params.sessionToken
        },
    })
}

//更新告警状态
export function updateAlarmStatus(data) {
    return request({
        url: "/system/alarmInfo/updateAlarmStatusGs",
        method: "post",
        data
    })
}